package com.company.Offer;

public class LK15 {
    public static void main(String[] args) {
       StringBuilder s= new StringBuilder("012345678 ");
       if(s.length()==10){
           s.insert(10,"abcdef");
           s.delete(3,8);
           System.out.println(s.indexOf("c"));
       }
    }
    public int hammingWeight(int n) {
        String str = Integer.toBinaryString(n);
        char[] arr = str.toCharArray();
        int x = 0;
        for(int i =0;i<arr.length;i++){
            if(arr[i]=='1'){
                x++;
            }
        }
        return  x;
        //return Integer.bitCount(n);
    }
}
